//
//  YMMapUtils.swift
//  Driver
//
//  Created by lantaiyuan on 2017/11/1.
//  Copyright © 2017年 youmy. All rights reserved.
//

import Foundation

class YMLatLng: NSObject {
    var lat:Double = 0.0
    var lng:Double = 0.0
}

func lines(_ path: String) -> [YMLatLng]{
    
    let lineString = path as NSString
    
    let coors = lineString.components(separatedBy: "|") as [NSString]
    
    var latLngs = [YMLatLng]()
    for obj in coors {
        
        let coors = obj.components(separatedBy: ",")
        
        let latLng = YMLatLng()
        latLng.lat = Double(coors[1])!
        latLng.lng = Double(coors[0])!
        latLngs.append(latLng)
    }
    
    return latLngs
}
